﻿using System;
using BlankMvc.Dao.Entities.Base;
using FluentNHibernate.Mapping;

namespace BlankMvc.Dao.Entities.Impl {
	public class User : Entity<int> {
		public virtual string Name { get; set; }
		public virtual string Login { get; set; }
		public virtual string PasswordHash { get; set; }
		public virtual string Email { get; set; }
		public virtual string Address { get; set; }
		public virtual string TestProp { get; set; }
		public virtual DateTime DateBird { get; set; }
	}

	public class UserMap : ClassMap<User> {
		public UserMap() {
			Table("Users");
			Id(x => x.Id);
			Map(x => x.DateBird);
			Map(x => x.Login).Unique().Length(100);
			Map(x => x.Name).Length(100);
			Map(x => x.Email).Unique().Length(100);
			Map(x => x.Address).Length(200);
			Map(x => x.PasswordHash).Length(200);
		}
	}
}
